<%@ page import="lf.day0109.travel.dao.TravelDao" %>
<%@ page import="lf.day0109.travel.impl.TravelDaoImpl" %>
<%@ page import="lf.day0109.travel.entity.Route" %><%--
  Created by IntelliJ IDEA.
  User: 19256
  Date: 2023/1/9
  Time: 23:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>旅游路线添加</title>
    <%
        String name = request.getParameter("name");
        String type = request.getParameter("tourType");
        String price = request.getParameter("price");
        String userName = request.getParameter("userName");
        String userPhone =request.getParameter("userPhone");
        TravelDao travelDao = new TravelDaoImpl();
        Route route = new Route();
        route.setTrName(name);
        route.setType(type);
        route.setPrice(price);
        route.setPhone(userPhone);
        route.setUser(userName);
        int addRes = travelDao.addRoute(route);
        if (addRes > 0){
            request.getRequestDispatcher("tour.jsp").forward(request,response);
        }else{
            out.println("添加失败");
        }
    %>
</head>
<body>

</body>
</html>
